﻿/// <reference path="jquery-1.9.1.js" />
/// <reference path="jquery.dataTables.js" />

$(function () {

    $("#btnXiaoShoue").on("click", function () {
        XiaoShoue();
    });

    $("#btnDanGeKeFu").on("click", function () {
        XiaoShoueDanGeKeFu();
    });

    $("#btnZhuanHuaLv").on("click", function () {
        ZhuanHuaLv();
    });

    $("#btnXiaoShouLiang").on("click", function () {
        XiaoShouLiang();
    });

    $("#btnKeDanJia").on("click", function () {
        KeDanJia();
    });

    $("#btnKeJianShu").on("click", function () {
        KeJianShu();
    });

    $("#btnManYiDu").on("click", function () {
        ManYiDu();
    });
});

function XiaoShoue() {

    var oTable = $('#divXiaoShoue').dataTable({
        "bProcessing": true,
        "bDestroy": true,
        "sAjaxSource": "/GridData/XiaoShoue/1",
        "aoColumns": [
            { "mData": "OrderDate" },
            { "mData": "TotalPrice" },
            { "mData": "UnPaidPrice" },
            { "mData": "SilentPaidPrice" },
            { "mData": "TeamPaidPrice" },
            { "mData": "RefundingPrice" },
            { "mData": "RefundedPrice" }
        ]
    });
}

//    $('#chartXiaoshoue').highcharts({
//        chart: {
//            renderTo: 'AAAAAAAAAAAAA',
//            type: 'column'
//        },
//        title: {
//            text: '图表'
//        },
//        xAxis: {
//            title: {
//                text: 'Fruit Number1'
//            },
//            tickInterval: 1
//        },
//        yAxis: {
//            title: {
//                text: 'CCCCCCCCC'
//            },
//            tickInterval: 1
//        },
//        series:
//        [{
//            name: 'A',
//            data: [1, 2, 4, 5]
//        },
//        {
//            name: 'B',
//            data: [5, 7, 3]
//        }]
//    });


function XiaoShoueDanGeKeFu() {

    var oTable = $('#divXiaoShoue').dataTable({
        "bProcessing": true,
        "bDestroy": true,
        "sAjaxSource": "/GridData/XiaoShoue/2/",
        "aoColumns": [
            { "mData": "OrderDate" },
            { "mData": "TotalPrice" },
            { "mData": "UnPaidPrice" },
            { "mData": "SilentPaidPrice" },
            { "mData": "TeamPaidPrice" },
            { "mData": "RefundingPrice" },
            { "mData": "RefundedPrice" }
        ]
    })
};

//销售量
function XiaoShouLiang() {

    var oTable = $('#divXiaoShouLiang').dataTable({
        "bProcessing": true,
        "bDestroy": true,
        "sAjaxSource": "/GridData/XiaoShouLiang",
        "aoColumns": [
            { "mData": "OrderDate" },
            { "mData": "TotalOrders" },
            { "mData": "UnpaidOrders" },
            { "mData": "SilentOrders" },
            { "mData": "TeamOrders" },
            { "mData": "RefundingOrders" },
            { "mData": "RefundOrders" }
        ]
    });

}

//转化率
function ZhuanHuaLv() {

    var oTable = $('#divZhuanHuaLv').dataTable({
        "bProcessing": true,
        "bDestroy": true,
        "sAjaxSource": "/GridData/ZhuanHuaLv",
        "aoColumns": [
            { "mData": "OrderDate" },
            { "mData": "TotalOrders" },
            { "mData": "UnpaidOrders" },
            { "mData": "SilentOrders" },
            { "mData": "TeamOrders" },
            { "mData": "RefundingOrders" },
            { "mData": "RefundOrders" }
        ]
    });

}

//客单价
function KeDanJia() {

    var oTable = $('#divKeDanJia').dataTable({
        "bProcessing": true,
        "bDestroy": true,
        "sAjaxSource": "/GridData/XiaoShoue",
        "aoColumns": [
            { "mData": "OrderDate" },
            { "mData": "TotalCustomerPrice" },
            { "mData": "UnpaidCustomerPrice" },
            { "mData": "SilentPaidCustomerPrice" },
            { "mData": "TeamPaidCustomerPrice" },
            { "mData": "RefundingCustomerPrice" },
            { "mData": "RefundCustomerPrice" }
        ]
    });

}

//客件数
function KeJianShu() {

    var oTable = $('#divKeJianShu').dataTable({
        "bProcessing": true,
        "bDestroy": true,
        "sAjaxSource": "/GridData/KeJianShu",
        "aoColumns": [
            { "mData": "OrderDate" },
            { "mData": "TotalCustomerCount" },
            { "mData": "UnpaidCustomerCount" },
            { "mData": "SilentPaidCustomerCount" },
            { "mData": "TeamPaidCustomerCount" },
            { "mData": "RefundingCustomerCount" },
            { "mData": "RefundCustomerCount" }
        ]
    });

}


//满意度
function ManYiDu() {

    var oTable = $('#divManYiDu').dataTable({
        "bProcessing": true,
        "bDestroy": true,
        "sAjaxSource": "/GridData/ManYiDu",
        "aoColumns": [
            { "mData": "OrderDate" },
            { "mData": "DefaultGoodComment" },
            { "mData": "NonDefaultGoodComment" },
            { "mData": "NeutralComment" },
            { "mData": "BadComment" },
            { "mData": "SellerGoodCommentsReply" },
            { "mData": "SellerNeutralCommentsReply" },
            { "mData": "SellerBadCommentsReply" },
            { "mData": "GoodCommentRate" },
            { "mData": "NeutralCommentRate" },
            { "mData": "BadCommentRate" }
        ]
    });
}